---
title: Open Telemetry
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

Logflare features OpenTelemetry integration to ingest directly from OpenTelemetry SDKs.

:::note
This feature is under development and is considered alpha stage. It is not advisable to use it for mission critical production workloads.
:::

The ingestion url is `https://otel.logflare.app:443`.

Supported ingestion formats:

- http/protobuf
- http/json
- grpc/protobuf

### Configuration Examples

<Tabs>
  <TabItem value="erlang" label="Erlang" default>

```erlang
%% config/sys.config.src
[
 {opentelemetry, [
    {span_processor, batch},
    {traces_exporter, otlp}
  ]},

 {opentelemetry_exporter, [
    {otlp_protocol, grpc},
    {otlp_compression, gzip},
    {otlp_endpoint, "https://otel.logflare.app:443"},
    {otlp_headers, [
      {"x-source", "my-source-id"},
      {"x-api-key", "my-access-token"}
    ]}
  ]}
].
```

  </TabItem>
  <TabItem value="elixir" label="Elixir">

```elixir
# config/config.exs
config :opentelemetry,
  span_processor: :batch,
  traces_exporter: :otlp

config :opentelemetry_exporter,
  otlp_protocol: :grpc,
  otlp_compression: :gzip,
  otlp_endpoint: "https://otel.logflare.app:443",
  otlp_headers: [
    {"x-source", "my-source-uuid"},
    {"x-api-key", "my-access-token"}
  ]
```

  </TabItem>
</Tabs>

### Testing OpenTelemetry ingestion locally

Clone the Github repo, and then run the following:

```bash
# for bq backend
docker compose -f docker-compose.yml -f docker-compose.latest.yml up -d db logflare
# for pg backend
docker compose -f docker-compose.yml -f docker-compose.pg.yml -f docker-compose.latest.yml up -d db logflare
```

1. Create a new source to populate the `x-source` header with the source UUID.
2. Use the api-key found in `.docker.env` and set it to `x-api-key` header
3. Set the otlp endpoint to `http://localhost:50051`
4. Start your OpenTelemetry instrumented app.

### Limitations

- Only **traces** and **metrics** are currently supported.
